#ifndef __DEBUG_H__
#define __DEBUG_H__

// #include "stdio.h"

// printf 颜色定义
/***************************************************************
字背景颜色范围: 40--49                   字颜色: 30--39
                40: 黑                           30: 黑
                41: 红                           31: 红
                42: 绿                           32: 绿
                43: 黄                           33: 黄
                44: 蓝                           34: 蓝
                45: 紫                           35: 紫
                46: 深绿                         36: 深绿
                47: 白色                         37: 白色
****************************************************************/
#define PTCOLOR_NONE 		"\033[m"
#define PTCOLOR_RED 		"\033[0;32;31m"
#define PTCOLOR_LIGHT_RED 	"\033[1;31m"
#define PTCOLOR_GREEN 		"\033[0;32;32m"
#define PTCOLOR_LIGHT_GREEN "\033[1;32m"
#define PTCOLOR_BLUE 		"\033[0;32;34m"
#define PTCOLOR_LIGHT_BLUE 	"\033[1;34m"
#define PTCOLOR_DARY_GRAY 	"\033[1;30m"
#define PTCOLOR_CYAN 		"\033[0;36m"
#define PTCOLOR_LIGHT_CYAN 	"\033[1;36m"
#define PTCOLOR_PURPLE 		"\033[0;35m"
#define PTCOLOR_LIGHT_PURPLE "\033[1;35m"
#define PTCOLOR_BROWN 		"\033[0;33m"
#define PTCOLOR_YELLOW 		"\033[1;33m"
#define PTCOLOR_LIGHT_GRAY 	"\033[0;37m"
#define PTCOLOR_WHITE 		"\033[1;37m"

/*
#if (ERROR)
#define xerror(fmt, args...)	printf( RED "ERROR <%s : %d> => " fmt " " NONE, __FUNCTION__, __LINE__, ##args)
#else
#define xerror(fmt, args...)
#endif
*/


/* 打印等级控制 */
#define D_LOG_D_ENABLE      (1)     /* debug */
#define D_LOG_I_ENABLE      (1)     /* info */
#define D_LOG_W_ENABLE      (1)     /* warning */
#define D_LOG_E_ENABLE      (1)     /* error */

#if D_LOG_D_ENABLE
// #define log_d(fmt, args...) printf(PTCOLOR_WHITE "D " fmt " " PTCOLOR_NONE, ##args)
#define log_d   printf
#else
// #define log_d(fmt, args...)
#define log_d
#endif

#if D_LOG_I_ENABLE
// #define log_i(fmt, args...) printf(PTCOLOR_PURPLE "I " fmt " " PTCOLOR_NONE, ##args)
#define log_i   printf
#else
// #define log_i(fmt, args...)
#define log_i
#endif

#if D_LOG_W_ENABLE
// #define log_w(fmt, args...) printf(PTCOLOR_YELLOW "W " fmt " " PTCOLOR_NONE, ##args)
#define log_w   printf
#else
// #define log_w(fmt, args...)
#define log_w
#endif

#if D_LOG_E_ENABLE
// #define log_e(fmt, args...) printf(PTCOLOR_RED "E " fmt " " PTCOLOR_NONE, ##args)
#define log_e   printf
#else
// #define log_e(fmt, args...)
#define log_e
#endif


void debug_uart_config(void);

#endif //__DEBUG_H__
